package cn.wolfcode.rbac.exception;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.ServletException;
import java.io.IOException;

@ControllerAdvice
public class CRMExceptionHandler {

    @ExceptionHandler(RuntimeException.class)
    public String handleException(Exception ex, Model model) throws ServletException, IOException {
        model.addAttribute("ex", ex);
        return "common/error";
    }
}
